using System;
using System.Collections.Generic;
using System.Text;

namespace cuberga.Utils
{
    public class Rand
    {
        static readonly private Rand _instance = new Rand();
        private Random _rand = null;

        static Rand() {}

        public static Rand Instance
        {
            get
            {
                return _instance;
            }
        }

        public Rand()
        {
            _rand = new Random(unchecked((int)DateTime.Now.Ticks));
        }

        public int Next(int iMinValue, int iMaxValue)
        {
            return _rand.Next(iMinValue, iMaxValue);
        }

        public int Next(int iMaxValue)
        {
            return _rand.Next(iMaxValue);
        }

        public double NextDouble()
        {
            return _rand.NextDouble();
        }
    }
}
